<?php

function get($url,$fn){
    $method = $_SERVER['REQUEST_METHOD'];
    $_url = $_SERVER['REQUEST_URI'];
    $_url_str = explode('?',$_url);
    $_zurl = $_url_str[0];
    if($url==$_zurl){
        if($method=='GET'){
          $fn($_GET);
        }else{
            exit('ti is must get methods');
        }
    }

}

function post($url,$fn){
    $method = $_SERVER['REQUEST_METHOD'];
    $_url = $_SERVER['REQUEST_URI'];
    $_url_str = explode('?',$_url);
    $_zurl = $_url_str[0];
    if($url==$_zurl){
        if($method=='POST'){
            $fn($_POST);
        }else{
            exit('ti is must POST methods');
        }
    }

}
function all($url,$fn){
    $_url = $_SERVER['REQUEST_URI'];
    $_url_str = explode('?',$_url);
    $_zurl = $_url_str[0];
    if($url==$_zurl){
            $fn($_REQUEST);

    }

}